// license-header java merge-point
/**
 * This is only generated once! It will never be overwritten. You can (and have to!) safely modify it by hand.
 */
package org.tinaelle.server.service;

import org.tinaelle.ServiceLocator;
import org.tinaelle.common.dto.AdObjectDTO;
import org.tinaelle.hibernate.audit.HibernateAuditInterceptor;

/**
 * @see org.tinaelle.service.OnlineFreeJobService
 */
public class TinaelleServiceImpl extends org.tinaelle.server.service.TinaelleServiceBase {

	/**
     * 
     */
	private static final long	serialVersionUID	= 1L;

	/**
	 * @see org.tinaelle.service.OnlineFreeJobService#setup(boolean)
	 */
	@Override
	protected void handleSetup(final boolean fillDummyData) throws java.lang.Exception {
		ServiceLocator.instance().getAdParameterService().fillInitialValues();
		ServiceLocator.instance().getAdSystemService().fillInitialValues();
		ServiceLocator.instance().getAdSecurityService().fillInitialValues();

		if ( fillDummyData ) {
			ServiceLocator.instance().getAdSecurityService().fillDummyValues();
		}
	}

	@Override
	protected void handleEnableAudit() throws Exception {
		HibernateAuditInterceptor.isActive = true;
	}

	@Override
	protected void handleDisableAudit() throws Exception {
		HibernateAuditInterceptor.isActive = false;
	}

	@Override
	protected boolean handleIsAuditEnabled() throws Exception {
		return HibernateAuditInterceptor.isActive;
	}

	@Override
	protected void handleFillInitialValues() throws Exception {
		// TODO Auto-generated method stub

	}

	@Override
	public void preSave(AdObjectDTO adObjectDTO, boolean isNew) {
		// TODO Auto-generated method stub
	}

}